call writeln(ph,'[¿]' || '0A'X || 'GUI Template¿call buildgui()%n do while ~eof(pipe)%n call topipe(''con'')%n in=readln(pipe)%n parse var in in1 in2 in3 in4 in5%n select%n when in1==''close'' then say ''bye bye''%n otherwise say in%n end%n end%nexit(0)%n%nbuildgui:%nif ~open(pipe,''awnpipe:noname/xc'') then exit(1)%ncall topipe(''"No Name" defg cs a h m'')%n')
call writeln(ph,'call topipe(''layout v b 5 gt "New Layout"'')%ncall topipe(''button gt "New Gadget"'')%ncall topipe(''button gt "Quit Gadget" c'')%ncall topipe(''le'')%ncall topipe(''open'')%nreturn%n%ntopipe:%nparse arg out%ncall writeln(pipe,out); res=readln(pipe)%nparse var res res1 res2 .%nif res1=''ok'' then return(res2)%nsay ''error from: ''out; say '' responce: '' res; exit%n')
if open(hh,'awnpipe:clip/C','W')==0 then call req( locales( MSG_Error ),locales( MSG_ClipError ),'_OK :-\')
call newlines(msgs.lstat.seld.text)
do c=1 to coms.0 ;
if c==coms.0 then call writech(hh,coms.c)
else; call writeln(hh,coms.c)
end
call close(hh)
if beep~=0 then call topipe('beep=1')
if warnclip~=0 then do
call topipe('id 0 s 264 gt "--> 'nocom(msgs.lstat.seld.name)'"')
call delay(warnclip)
call topipe('id 0 s 520 gt "Clipper => bsteers@btinternet.com"')
end
end
end
otherwise nop /*say in*/
end
return
newlines:
p=0 ; txt=arg(1)
p=1
do xx=1 while p>0
p=index(upper(txt),'%N',1)
if p~=0 then do
coms.0=xx
coms.xx=substr(txt,1,p-1)
txt=substr(txt,p+2)
end
else do
coms.0=xx
coms.xx=txt
p=-20
end
end
return
swapp:
tmp=listem.c
tmpc.0=msgs.c.0
do y=1 to tmpc.0 ; tmpc.y.name=msgs.c.y.name; tmpc.y.text=msgs.c.y.text; end
msgs.c.0=msgs.cc.0
do y=1 to msgs.c.0 ; msgs.c.y.name=msgs.cc.y.name; msgs.c.y.text=msgs.cc.y.text; end
msgs.cc.0=tmpc.0
do y=1 to tmpc.0 ; msgs.cc.y.name=tmpc.y.name; msgs.cc.y.text=tmpc.y.text; end
listem.c=listem.cc
listem.cc=tmp
return
movepage: ;
if arg(1)='U' then cc=lstat-1; else; cc=lstat+1;
c=lstat
call swapp()
lstat=cc ; call makelist()
return
delpage: ;
np=listem.0 ; np=np-1 ; listem.0=np
do n=lstat to np
plus=n+1
listem.n=listem.plus
msgs.n.0=msgs.plus.0;
do y=1 to msgs.n.0; msgs.n.y.name=msgs.plus.y.name ; end
end
lstat=min(lstat,listem.0)
call makelist()
call freshlist()
call topipe('id 'pags' gt "'listem.lstat'" ref')
return
makegui:
call open(pipe,"awnpipe:Clipper/xc")
call topipe('"Clipper bsteers@btinternet.com" v left 'wl' top 'wt' width 'ww' height 'wh' sk st "Clipper By Bruce Steers 'ver' 'verdate'" m h sc="¿" defg ig it "Clipper.Zzz" ii "'progname'" a ps "'screen'"')
topipe: ; parse arg out; call writeln(pipe,out); res=readln(pipe); parse var res res1 res2 .; if res1='ok' then return(res2);say locales(MSG_Error)' from: 'out; say ' <--: ' res; IF pipe~=0 THEN call close(pipe); call cleanexit
req:
if openp=='main' then call topipe('id 0 s 256')
parse arg rbar,rtxt,rg1,rg2,rg3,rg4,rg5,rg6,rg7,rg8 .; if rf~=0 then call close(rf); call open(rf,'awnpipe:ClipperReq/xc'); call writeln(rf,'"'rbar'" v it "Clipper" sw dg db a ps "'screen'"');
call writeln(rf,'space');; call writeln(rf,'layout b 5'); call writeln(rf,'space'); call writeln(rf,'label so weih 5 weiw 10 gt "*n*n'rtxt'"'); call writeln(rf,'space'); call writeln(rf,'le'); call writeln(rf,'layout b 0 si so');
if rg1~="" then call writeln(rf,'button gt "'rg1'" close');if rg2~="" then call writeln(rf,'button gt "'rg2'" close');if rg3~="" then call writeln(rf,'button gt "'rg3'" close'); if rg4~="" then call writeln(rf,'button gt "'rg4'" close');
if rg5~="" then call writeln(rf,'button gt "'rg5'" close');if rg6~="" then call writeln(rf,'button gt "'rg6'" close');if rg7~="" then call writeln(rf,'button gt "'rg7'" close');if rg8~="" then call writeln(rf,'button gt "'rg8'" close');
call writeln(rf,'le'); call writeln(rf,'open');call readln(rf); do while ~eof(rf); rn=readln(rf); parse var rn rn1 rn2 rn3 rn4 rn5 .; if rn1=='gadget' then do; if openp=='main' then call topipe('id 0 s 512');return(rn2-2); end; end;if openp=='main' then call topipe('id 0 s 512'); return(0)